<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body onload="show()">
<div class="container-fluid">
	<button class="btn" type="button" name="index" style="background: #00b4ef; position: absolute; top: 15px;right: 50px;"><a href="/Home/Login/login">首页</a></button>
	<button class="btn btn-success" type="button" name="whitelist" style="background: #660099; position: absolute; top: 50px;right: 50px;"><a href="/Home/Hard/whitelist">白名单管理</a></button>
	<div class="row-fluid">
		<div class="span12">
			<h1>固件更新</h1>
			<ul class="nav nav-tabs">
				<li class="active">
					<a href="#">发布记录</a>
				</li>
				<li>
					<a href="/Home/Hard/index">上传版本</a>
				</li>
				<li class="">
					<a href=/Home/Hard/white>白名单测试</a>
				</li>
				<li class="">
					<a href="/Home/Hard/confirm">正式发布</a>
				</li>
			</ul>
			<table class="table">
				<thead>
				<tr>
					<th>
						发布日期
					</th>
					<th>
						发布系统
					</th>
					<th>
						发布版本
					</th>
					<th>
						版本大小
					</th>
					<th>
						更新文案
					</th>
					<th>
						系统通知
					</th>
					<th>
						url
					</th>
				</tr>
				</thead>
				<tbody>
				<volist name="data" id="ls">
					<tr>
						<td>
							{$ls.createtime|date="Y-m-d",###}
						</td>
						<td>
							{$ls.sys}
						</td>
						<td>
							{$ls.version}
						</td>
						<td>
							{$ls.size}
						</td>
						<td>
							<textarea type="text"  class="doc" name="doc" cols="40" rows="10" disabled="disabled" readonly="readonly" style="BORDER-BOTTOM: 0px solid; BORDER-LEFT: 0px solid; BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid;">{$ls.doc}</textarea>
						</td>
						<td>
							<textarea type="text"  class="sysinfo" name="sysinfo" cols="40" rows="10" disabled="disabled" readonly="readonly" style="BORDER-BOTTOM: 0px solid; BORDER-LEFT: 0px solid; BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid;">{$ls.sysinfo}</textarea>
						</td>
						<td>
							<textarea type="text"  class="doc" name="doc" cols="30" rows="4" disabled="disabled" readonly="readonly" style="BORDER-BOTTOM: 0px solid; BORDER-LEFT: 0px solid; BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid;">{$ls.url}</textarea>
						</td>
						<td>
							<div style="visibility: hidden" name="hidden">
								<button class="btn btn-warning" type="button" id="{$ls.id}" onclick="eventshelf(this.id)" style="float:left; clear: both">下线</button>
								<button class="btn btn-danger" type="button" id="{$ls.id}" onclick="eventremove(this.id)" style="float:left; clear: both">删除</button>
							</div>
							<button class="btn btn-success" type="button" name="upload" style="float:left; clear: both"><a href="{$ls.url}">下载</a> </button>
						</td>
					</tr>
				</volist>
				</tbody>
			</table>
			<
		</div>
	</div>
</div>
</body>
<script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
<script src="//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script type="text/javascript">

    function eventremove(eve){
        var r=confirm("确认删除？");
        if(r ==true){
            var id = eve;
            $.post('/Home/Hard/remove',{id:id},function(data){
                if (data.status > 0) {
                    alert('删除成功！');
                    window.location.reload();
                } else {
                    alert('删除失败！');
                    window.location.reload();
                }
            })
        }


    }
    function eventshelf(eve){
        var r=confirm("确认下线？");
        if(r ==true){
            var id = eve;
            $.post('/Home/Hard/shelf',{id:id},function(data){
                if (data.status > 0) {
                    alert('下线成功！');
                    window.location.reload();
                } else {
                    alert('下线失败！');
                    window.location.reload();
                }
            })
        }
    }
    function show() {
        var x = document.getElementsByName('hidden');
        var aut="{:session('pubshow')}";
        if(aut == true) {
            for(var i=0;i<x.length;i++) {
                x[i].style.visibility = 'visible';
            }
        }
    }
</script>
<script>
    function jump(){
        window.location.href='/Home/Login/login';
    }
</script>
</html>